package com.hhs.storage.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author shadow
 * @since 2018-09-29
 */
@Data
@ToString
@TableName("base_role")
public class BaseRole extends Model<BaseRole> {

    private static final long serialVersionUID = 1L;

    @TableId("id_")
    private String id;
    @TableField("name_")
    private String name;
    @TableField("flag_")
    private String flag;
    @TableField("create_time_")
//    @JSONField(format="yyyy-MM-dd")
    @JSONField(serialize = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
